 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rational.sheet.table.cell.model.setting;

import java.awt.Color;
import java.awt.Font;

/**
 *
 * @author Overmind
 */
public class CellView
    implements FormatConstants
{
    public static final FontFormat DEFAULT_FONT_FORMAT = new FontFormat();
    public static final VerticalAlignment DEFAULT_VERTICAL_ALIGNMENT = VerticalAlignment.CENTER;
    public static final HorizontalAlignment DEFAULT_HORIZONTAL_ALIGNMENT = HorizontalAlignment.CENTER;
    public static final Color DEFAULT_BACKGROUND_COLOR = Color.white;
    public static final Color DEFAULT_TEXT_COLOR = Color.black;
    
    private FontFormat fontFormat;
    private VerticalAlignment verticalAlignment;
    private HorizontalAlignment horizontalAlignment;
    private Color backgroundColor;
    private Color textColor;

    public CellView()
    {
	this(DEFAULT_FONT_FORMAT, DEFAULT_VERTICAL_ALIGNMENT, DEFAULT_HORIZONTAL_ALIGNMENT,
		DEFAULT_BACKGROUND_COLOR, DEFAULT_TEXT_COLOR);
    }
    
    public CellView(FontFormat fontFormat, 
            VerticalAlignment verticalAlignment, 
            HorizontalAlignment horizontalAlignment, 
            Color backgroundColor, Color textColor)
    {
        this.backgroundColor = backgroundColor;
        this.textColor = textColor;
        this.fontFormat = fontFormat;
        this.horizontalAlignment = horizontalAlignment;
        this.verticalAlignment = verticalAlignment;
    }

    public FontFormat getFontFormat()
    {
        return fontFormat;
    }

    public VerticalAlignment getVerticalAlignment()
    {
        return verticalAlignment;
    }

    public HorizontalAlignment getHorizontalAlignment()
    {
        return horizontalAlignment;
    }

    public Color getBackgroundColor()
    {
        return backgroundColor;
    }

    public Color getTextColor()
    {
        return textColor;
    }
    
    public Font getFont()
    {
        return fontFormat.getFont();
    }
    
    public String getFontName()
    {
        return fontFormat.getName();
    }

    public int getFontSize()
    {
        return fontFormat.getSize();
    }

    public FontConstants.Thickness getFontThickness()
    {
        return fontFormat.getThickness();
    }

    public FontConstants.Slope getFontSlope()
    {
        return fontFormat.getSlope();
    }
    
    public void setVerticalAlignment(VerticalAlignment verticalAlignment)
    {
        this.verticalAlignment = verticalAlignment;
    }

    public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
    {
        this.horizontalAlignment = horizontalAlignment;
    }

    public void setBackgroundColor(Color backgroundColor)
    {
        this.backgroundColor = backgroundColor;
    }

    public void setTextColor(Color textColor)
    {
        this.textColor = textColor;
    }
    
    public void setFontName(String fontName)
    {
        fontFormat.setName(fontName);
    }

    public void setFontSize(int fontSize)
    {
        fontFormat.setSize(fontSize);
    }

    public void setFontThickness(FontConstants.Thickness fontThickness)
    {
        fontFormat.setThickness(fontThickness);
    }

    public void setFontSlope(FontConstants.Slope fontSlope)
    {
        fontFormat.setSlope(fontSlope);
    }
}

